package com.heima.wemedia.feign;

import com.heima.client.wemedia.WemediaUserClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.wemedia.service.WmUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Geralt
 * @Date 2024-08-02 10:25
 */
@RestController
@Slf4j
public class WmUserClient implements WemediaUserClient {
    @Autowired
    private WmUserService wmUserService;
    /**
     * 查询自媒体用户信息
     *
     * @param authorId
     * @return
     */
    @GetMapping("/api/v1/user/query_wmUser/{authorId}")
    public ResponseResult getWemediaUser(@PathVariable String authorId) {
        log.info("查询自媒体用户信息的数据是：{}", authorId);
        return wmUserService.queryUser(authorId);
    }
}
